var t = require("../../../@babel/runtime/helpers/typeof"), a = getApp();

Page({
    data: {
        list: [],
        current_page: 1,
        last_page: 1,
        status: "",
        active: 0,
        language: ""
    },
    onLoad: function(t) {
        var a = wx.getStorageSync("langIndex"), e = {
            page: 1
        };
        if ("undefined" !== t.status) {
            var s = t.status, n = "", i = 0;
            n = 4 == s ? "" : s, i = 1 == s ? 2 : 0 == s ? 1 : -1 == s ? 3 : n, this.setData({
                active: i
            }), e.status = n;
        }
        this.setData({
            language: a.en
        }), this.getData(e);
    },
    code_link: function(t) {
        wx.setClipboardData({
            data: t.currentTarget.dataset.orderid,
            success: function() {
                a.tips("复制成功");
            },
            fail: function(t) {
                a.tips("复制失败");
            }
        });
    },
    getData: function(t) {
        var e = this;
        a._getNetWork({
            url: a.getNetAddresss("plugin.tiktok-cps.api.order.order-list"),
            data: t,
            success: function(s) {
                var n = s.data, i = n.data, r = n.result, u = n.msg;
                if (0 == r) return a.tips(u);
                if (1 == t.page) e.setData({
                    list: i.list
                }); else {
                    var o = e.data.list.concat(i.lsit);
                    e.setData({
                        list: o
                    });
                }
                e.setData({
                    current_page: i.current_page,
                    last_page: i.last_page
                });
            }
        });
    },
    onChange: function(a) {
        var e = a.detail.index;
        this.setData({
            active: e
        }), console.log(e, "111", t(e));
        var s = "";
        s = 0 == e ? "" : 1 == e ? 0 : 2 == e ? 1 : -1, this.setData({
            status: s
        }), this.getData({
            page: 1,
            status: s
        });
    },
    getMoreData: function() {
        if (this.data.current_page >= this.data.last_page) return !1;
        var t = Number(this.data.current_page) + 1;
        this.getData({
            page: t,
            status: this.data.status
        });
    },
    onReady: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});